import json

class Community:
    def __init__(self, community_id, members, professor):
        self.community_id = community_id
        self.members = members
        self.professor = professor

def load_communities(file_path):
    try:
        with open(file_path, 'r', encoding='utf-8') as file:
            data = json.load(file)
            communities_list = []
            for class_data in data['classes']:
                community = Community(
                    community_id=class_data['name'],
                    members=class_data['students'],
                    professor=class_data['professor']
                )
                communities_list.append(community)
            return communities_list
    except FileNotFoundError:
        print(f"File not found: {file_path}")
        return []
    except Exception as e:
        print(f"An error occurred while loading communities: {e}")
        return []